Optimal. Leaf size=111 \[ \frac {(a+b) (a+2 b) \log (1-\sin (c+d x))}{2 d}+\frac {(a-2 b) (a-b) \log (1+\sin (c+d x))}{2 d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2800, 1659,
1643, 647, 31} \begin {gather*} \frac {2 a b \sin (c+d x)}{d}+\frac {(a+b) (a+2 b) \log (1-\sin (c+d x))}{2 d}+\frac {(a-2 b) (a-b) \log (\sin (c+d x)+1)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 1643
Rule 1659
Rule 2800
Rubi steps
\begin {align*} \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {x^3 (a+x)^2}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}+\frac {\text {Subst}\left (\int \frac {(a+x) \left (-2 b^4-2 a b^2 x-2 b^2 x^2\right )}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{2 b^2 d}\\ &=\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}+\frac {\text {Subst}\left (\int \left (4 a b^2+2 b^2 x-\frac {2 \left (3 a b^4+b^2 \left (a^2+2 b^2\right ) x\right )}{b^2-x^2}\right ) \, dx,x,b \sin (c+d x)\right )}{2 b^2 d}\\ &=\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {\text {Subst}\left (\int \frac {3 a b^4+b^2 \left (a^2+2 b^2\right ) x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{b^2 d}\\ &=\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {((a-2 b) (a-b)) \text {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}-\frac {((a+b) (a+2 b)) \text {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=\frac {(a+b) (a+2 b) \log (1-\sin (c+d x))}{2 d}+\frac {(a-2 b) (a-b) \log (1+\sin (c+d x))}{2 d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 108, normalized size = 0.97 \begin {gather*} \frac {2 (a+b) (a+2 b) \log (1-\sin (c+d x))+2 (a-2 b) (a-b) \log (1+\sin (c+d x))-\frac {(a+b)^2}{-1+\sin (c+d x)}+8 a b \sin (c+d x)+2 b^2 \sin ^2(c+d x)+\frac {(a-b)^2}{1+\sin (c+d x)}}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 135, normalized size = 1.22
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+2 a b \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(135\) |
default | \(\frac {a^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+2 a b \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(135\) |
risch | \(-\frac {4 i b^{2} c}{d}-\frac {2 i a^{2} c}{d}-\frac {b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-2 i b^{2} x -\frac {2 i \left (i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+a b \,{\mathrm e}^{3 i \left (d x +c \right )}-a \,{\mathrm e}^{i \left (d x +c \right )} b \right )}{d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )^{2}}-\frac {b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-i a^{2} x -\frac {i a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a b}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a b}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}\) | \(301\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 105, normalized size = 0.95 \begin {gather*} \frac {b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b \sin \left (d x + c\right ) + {\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, a b \sin \left (d x + c\right ) + a^{2} + b^{2}}{\sin \left (d x + c\right )^{2} - 1}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 140, normalized size = 1.26 \begin {gather*} -\frac {2 \, b^{2} \cos \left (d x + c\right )^{4} - b^{2} \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, a^{2} - 2 \, b^{2} - 4 \, {\left (2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \tan ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.72, size = 232, normalized size = 2.09 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (2\,a^2+4\,b^2\right )+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+1\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2+2\,b^2\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (a+b\right )\,\left (a+2\,b\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (a-b\right )\,\left (a-2\,b\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________